
package trabalhotec.BD;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Conexao {
    static{
        try{
            Class.forName("com.mysql.jdbc.Driver");
        }catch (ClassNotFoundException e){
            System.out.println("Erro ao carregar o Driver");
            e.printStackTrace();
        }
    }
    public static Connection abrirConexao() throws SQLException{
        Connection con = DriverManager.getConnection("jdbc:mysql://localhost/passagem","root",null);
        return con;
    }
}   
